home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / PROGEDIT / 3788.ZIP / QHLPQ.EXE / QHSETUP.BAT < prev    next >
DOS Batch File  |  1993-03-01  |  13KB  |  355 lines

  1. echo off
  2. cls
  3.  
  4. SET V1=0
  5. SET V2=0
  6. SET V3=0
  7. if not "%V1%"=="0" goto ENV
  8. if not "%V2%"=="0" goto ENV
  9. if not "%V3%"=="0" goto ENV
  10.  
  11. echo ╓─────────────── QHelpQ (C), SHAREWARE RELEASE Version 2.15a ───────────────╖
  12. echo ║                 ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀                 ║
  13. echo ║  This QHelpQ setup program will:                                            ║
  14. echo ║  MAKE a sub-DIR C:\QHelpQ. COPY the QHelpQ.EXE, QHelpQ1.EXE, QHelpQ.H!      ║
  15. echo ║  and support files to C:\QHelpQ. You can customize this installation later. ║
  16. echo ║                                                                             ║
  17. echo ║      To run this setup utility, you MUST be logged onto the drive and       ║
  18. echo ║      (in the sub-directory), containing ALL of the supplied QHelpQ files.   ║
  19. echo ║                                                                             ║
  20. echo ║   The SHAREWARE QHlpQ.EXE file MUST first be COPIED to a 'temporary' sub-   ║
  21. echo ║   directory on your HARD DRIVE. The QHlpQ file MUST then be EXECUTED, to    ║
  22. echo ║   EXTRACT all of its files. NOTE THAT THE SETUP UTILITY CAN BE RUN FROM     ║
  23. echo ║   A FLOPPY IF ALL OF THE EXTRACTED FILES WILL FIT (e.g. 5 1/4" Hi-Density   ║
  24. echo ║   or a 3 1/2" 720K byte or 1.4M byte).                                      ║
  25. echo ║                                                                             ║
  26. echo ║ NOTE: If a C:\QHelpQ sub-directory exists, any files located there will be  ║
  27. echo ║       COPIED to a C:\QHelpQ\QHelpQ.OLD sub-directory. Note that the files   ║
  28. echo ║       in an existing C:\QHelpQ sub-directory are ONLY copied if files do    ║
  29. echo ║       NOT already exist in a C:\QHelpQ\QHelpQ.OLD sub-directory. This is to ║
  30. echo ║       prevent OVERWRITTING existing C:\QHelpQ\QHelpQ.OLD files.             ║
  31. echo ║                                                         see also README.BAT ║
  32. echo ║   Press [ CTRL C ] ... [ Y ] to abort setup, any other key to continue...   ║
  33. echo ║                                                                             ║
  34. echo ╚═[ SQ030193d ]══════════[ QhSetup.BAT, 01 Mar 93, Rhg ]══════════[ SQ0C79h ]═╝
  35. pause > nul
  36. cls
  37.  
  38. :                         TEST FOR ALL SOURCE FILES
  39. if not exist yes          SET V3=1
  40. if not exist Qh.BAT       SET V3=1
  41. if not exist QhM.BAT      SET V3=1
  42. if not exist QhS.BAT      SET V3=1
  43. if not exist Readme.BAT   SET V3=1
  44. if not exist QHelpQ.DAT   SET V3=1
  45. if not exist Register.DOC SET V3=1
  46. if not exist QHelpQ.EXE   SET V3=1
  47. if not exist QHelpQ1.EXE  SET V3=1
  48. if not exist QHelpQ.H!    SET V3=1
  49. if not exist QhSetup.P0   SET V3=1
  50. if not exist ReadMe.P0    SET V3=1
  51. if not exist ReadMe.P1    SET V3=1
  52. if not exist ReadMe.P2    SET V3=1
  53. if not exist ReadMe.P3    SET V3=1
  54. if not exist ReadMe.P4    SET V3=1
  55. if not exist ReadMe.P5    SET V3=1
  56. if not exist QHelpQ.TXT   SET V3=1
  57. if                           %V3%==1 goto ERROR
  58.  
  59. if exist C:\QHelpQ\*.*               goto SaveOld?
  60. if exist C:\QHelpQ\nul               goto SetV2
  61.  
  62. SET V1=1
  63. MD C:\QHelpQ
  64. if not exist C:\QHelpQ\nul           goto ABORT
  65.  
  66. :SetV2
  67. SET V2=5
  68.  
  69. :CopyYes
  70. copy yes C:\ > nul
  71. if not exist C:\yes                  goto ABORT
  72.  
  73. echo                                  QHSETUP.BAT
  74. echo.
  75. goto CopyNEW
  76.  
  77. :SaveOld?
  78. if exist C:\QHelpQ\QHelpQ.OLD\*.* goto WARNING
  79.  
  80. if     exist C:\QHelpQ\QHelpQ.OLD\nul SET V2=1
  81. if not exist C:\QHelpQ\QHelpQ.OLD\nul SET V2=2
  82. if not exist C:\QHelpQ\QHelpQ.OLD\nul MD C:\QHelpQ\QHelpQ.OLD
  83. if not exist C:\QHelpQ\QHelpQ.OLD\nul goto ABORT
  84.  
  85. echo                                  QHSETUP.BAT
  86. if %V2%==1 echo SAVING   OLD C:\QHelpQ files to EXISTING C:\QHelpQ\QHelpQ.OLD sub-DIR.
  87. if %V2%==2 echo SAVUNG   OLD C:\QHelpQ files to NEWLY CREATED C:\QHelpQ\QHelpQ.OLD sub-DIR.
  88. copy QHelpQ.H!     C:\QHelpQ\QHelpQ.OLD\DskFull1.TST > nul
  89. if not exist       C:\QHelpQ\QHelpQ.OLD\DskFull1.TST goto DiskFull
  90.  
  91. copy QHelpQ.H!     C:\QHelpQ\QHelpQ.OLD\DskFull2.TST > nul
  92. if not exist       C:\QHelpQ\QHelpQ.OLD\DskFull2.TST goto DiskFull
  93.  
  94. del                C:\QHelpQ\QHelpQ.OLD\DskFull1.TST
  95. del                C:\QHelpQ\QHelpQ.OLD\DskFull2.TST
  96. copy C:\QHelpQ\*.* C:\QHelpQ\QHelpQ.OLD > nul
  97. copy yes           C:\ > nul
  98.  
  99. :CopyNEW
  100. if exist C:\QHelpQ\*.* echo DELETING OLD C:\QHelpQ files...
  101. if exist C:\QHelpQ\*.* del C:\QHelpQ\*.* < C:\yes > nul
  102. if %V1%==1 echo COPYING  17 files, to NEWLY CREATED C:\QHelpQ ... please stand by...
  103. if %V1%==0 echo COPYING  17 files, to EXISTING C:\QHelpQ ... please stand by...
  104.            echo          NOTE: If the installation is being made from a FLOPPY DRIVE, do NOT
  105.            echo                remove the diskette from the floppy drive until told to do so!
  106. copy Qh.BAT       C:\QHelpQ
  107. copy Qhm.BAT      C:\QHelpQ
  108. copy Qhs.BAT      C:\QHelpQ
  109. copy Readme.BAT   C:\QHelpQ
  110. copy QHelpQ.DAT   C:\QHelpQ
  111. copy Register.DOC C:\QHelpQ
  112. copy QHelpQ.EXE   C:\QHelpQ
  113. copy QHelpQ1.EXE  C:\QHelpQ
  114. copy QHelpQ.H!    C:\QHelpQ
  115. copy Readme.P0    C:\QHelpQ
  116. copy Readme.P1    C:\QHelpQ
  117. copy Readme.P2    C:\QHelpQ
  118. copy Readme.P3    C:\QHelpQ
  119. copy Readme.P4    C:\QHelpQ
  120. copy Readme.P5    C:\QHelpQ
  121. copy QHelpQ.TXT   C:\QHelpQ
  122. copy QhSetup.P0   C:\QHelpQ
  123.  
  124. :                              CHECK INSTALLATION
  125. C:
  126. CD \QHelpQ
  127. if not exist Qh.BAT       SET V3=2
  128. if not exist QhM.BAT      SET V3=2
  129. if not exist QhS.BAT      SET V3=2
  130. if not exist Readme.BAT   SET V3=2
  131. if not exist QHelpQ.DAT   SET V3=2
  132. if not exist Register.DOC SET V3=2
  133. if not exist QHelpQ.EXE   SET V3=2
  134. if not exist QHelpQ1.EXE  SET V3=2
  135. if not exist QHelpQ.H!    SET V3=2
  136. if not exist QhSetup.P0   SET V3=2
  137. if not exist ReadMe.P0    SET V3=2
  138. if not exist ReadMe.P1    SET V3=2
  139. if not exist ReadMe.P2    SET V3=2
  140. if not exist ReadMe.P3    SET V3=2
  141. if not exist ReadMe.P4    SET V3=2
  142. if not exist ReadMe.P5    SET V3=2
  143. if not exist QHelpQ.TXT   SET V3=2
  144. if                           %V3%==2 goto ERROR
  145.  
  146. echo                           Press any key to continue...
  147. pause > nul
  148.  
  149. :               INSTALLATION SUCCESSFUL... Invoke QHelpQ @ LOGO
  150. QHelpQ QHelpQ
  151.  
  152. cls
  153. echo                                  QHSETUP.BAT
  154. echo.
  155. if %V2%==0 echo           C:\QHelpQ\QHelpQ.OLD DIR and files existed, therefore
  156. if %V2%==0 echo           (with your permission), OLD C:\QHelpQ files were NOT saved.
  157. if %V2%==0 goto byPass
  158. if %V2%==5 goto byPass1
  159.  
  160. echo.
  161. echo NOTE: Files from an existing C:\QHelpQ sub-directory were COPIED to the
  162. echo       C:\QHelpQ\QHelpQ.OLD sub-directory. If you wish to SAVE these files,
  163. echo       you should COPY them to a FLOPPY and then DELETE the files from the
  164. echo       C:\QHelpQ\QHelpQ.OLD sub-directory. Then REMOVE the sub-directory.
  165.  
  166. :byPass
  167. echo.
  168. echo       Note that the files in an existing C:\QHelpQ sub-directory are ONLY
  169. echo       saved if files do NOT already exist in a C:\QHelpQ\QHelpQ.OLD
  170. echo       sub-directory. This is done to prevent OVERWRITTING any existing
  171. echo       C:\QHelpQ\QHelpQ.OLD files.
  172.  
  173. :byPass1
  174. echo.
  175. echo.
  176. echo       IF you created a 'temporary' sub-directory, on your HARD DRIVE,
  177. echo       for the self-extractor ( QHlpQ.EXE ), and the extracted files;
  178. echo.
  179. echo           DELETE all of the files in  the 'temporary' sub-directory
  180. echo           you created.  Then, REMOVE  the 'temporary' sub-directory.
  181. echo 
  182. echo                          Press any key to continue...
  183. pause > nul
  184.  
  185. cls
  186. type QhSetup.P0
  187. del  QhSetup.P0
  188. echo                           Press any key to continue...
  189. pause > nul
  190. cls
  191. echo                                  QHSETUP.BAT
  192. echo.
  193. goto preEND
  194.  
  195. :ENV
  196. cls
  197. echo                                  QHSETUP.BAT
  198. echo.
  199. echo              ERROR !  You do NOT have enough environmental space
  200. echo                       to store the following needed variable(s).
  201. echo.
  202. if not "%V1%"=="0" echo                              'V1' requires 6 bytes
  203. if not "%V2%"=="0" echo                              'V2' requires 6 bytes
  204. if not "%V3%"=="0" echo                              'V3' requires 6 bytes
  205. echo.
  206. echo   You have two choices:
  207. echo   The 1st., and EASIEST, is to temporarly shorten your 'PATH' by the total
  208. echo   number of bytes shown above.  After QHelpQ has been installed, you can
  209. echo   revert back to your normal 'PATH'.
  210. echo.
  211. echo   The 2nd., and MOST DESIREABLE for future use, is to add a SHELL statement
  212. echo   to your Config.SYS file.  Since the syntax ( # of bytes ), for the SHELL
  213. echo   statement is DOS-VER dependent, it is NOT given here. See your DOS manual.
  214. echo 
  215. if "%V1%"=="0" SET V1=
  216. if "%V2%"=="0" SET V2=
  217. if "%V3%"=="0" SET V3=
  218. goto END
  219.  
  220. :ERROR
  221. cls
  222. echo                                  QHSETUP.BAT
  223. echo.
  224. if %V3%==2 echo ERROR ! The following file(s) did NOT get COPIED to the C:\QHelpQ
  225. if %V3%==2 echo ▀▀▀▀▀   sub-directory. INSTALLATION FAILED! PROBABLE CAUSE = DISK FULL.
  226. if %V3%==2              goto SkipYes
  227.  
  228. if %V3%==1 echo ERROR ! Can NOT find the following SOURCE file(s). You MUST execute QhSetup
  229. if %V3%==1 echo ▀▀▀▀▀   from the DRIVE and DIR containing ALL of the QHelpQ SOURCE files.
  230. if not exist yes          echo yes
  231.  
  232. :SkipYes
  233. if not exist Qh.BAT       echo Qh.BAT
  234. if not exist Qhm.BAT      echo Qhm.BAT
  235. if not exist Qhs.BAT      echo Qhs.BAT
  236. if not exist Readme.BAT   echo ReadMe.BAT
  237. if not exist QHelpQ.DAT   echo QHelpQ.DAT
  238. if not exist Register.DOC echo Register.DOC
  239. if not exist QHelpQ.EXE   echo QHelpQ.EXE
  240. if not exist QHelpQ1.EXE  echo QHelpQ1.EXE
  241. if not exist QHelpQ.H!    echo QHelpQ.H!
  242. if not exist QhSetup.P0   echo QhSetup.P0
  243. if not exist ReadMe.P0    echo ReadMe.P0
  244. if not exist ReadMe.P1    echo ReadMe.P1
  245. if not exist ReadMe.P2    echo ReadMe.P2
  246. if not exist ReadMe.P3    echo ReadMe.P3
  247. if not exist ReadMe.P4    echo ReadMe.P4
  248. if not exist ReadMe.P5    echo ReadMe.P5
  249. if not exist QHelpQ.TXT   echo QHelpQ.TXT
  250.            echo                          ABORTING QHelpQ INSTALLATION
  251. if %V3%==1 goto SrcERR
  252.  
  253. if %V2%==0 echo                  At your request, your old C:\QHelpQ files were
  254. if %V2%==0 echo                  NOT SAVED, and therefore CAN NOT be restored.
  255.  
  256. :SrcERR
  257. echo                          Press any key to continue...
  258. pause > nul
  259.  
  260. cls
  261. echo                                  QHSETUP.BAT
  262. echo.
  263. if %V3%==1 goto preEND
  264.  
  265. if not %V2%==0 echo                System RESTORED to pre-INSTALLATION conditions.
  266.                     CD \
  267. if exist QHelpQ\*.* del QHelpQ\*.* < yes > nul
  268.  
  269. if %V2%==0 goto RD_DIR
  270. if %V2%==5 goto RD_DIR
  271.  
  272.            CD   QHelpQ
  273.            copy QHelpQ.OLD\*.* > nul
  274.            del  QHelpQ.OLD\*.* < C:\yes > nul
  275. if %V2%==2 RD   QHelpQ.OLD
  276.  
  277. :RD_DIR
  278.            CD \
  279. if %V1%==1 RD QHelpQ
  280.            goto preEND
  281.  
  282. :ABORT
  283. cls
  284. echo                                  QHSETUP.BAT
  285. echo.
  286. echo                     DISK FULL ERROR... unable to Continue...
  287. echo                     NOT enough space for even a single file.
  288. goto Abort1
  289.  
  290. :WARNING
  291. echo                                  QHSETUP.BAT
  292. echo.
  293. echo WARNING:       Existing C:\QHelpQ files CAN NOT be SAVED because
  294. echo ▀▀▀▀▀▀▀        a C:\QHelpQ\QHelpQ.OLD DIR and files already exist.
  295. echo.
  296. echo      If you elect to continue, your old C:\QHelpQ files will be DELETED.
  297. echo.
  298. echo          ┌──────────────────────────────────────────────────────────┐
  299. echo          │    If you WANT to SAVE your existing C:\QHelpQ files;    │
  300. echo          │ PRESS [ CTRL C ] [ Y ] ... to ABORT QHelpQ INSTALLATION. │
  301. echo          └──────────────────────────────────────────────────────────┘
  302. echo.
  303. echo    THEN  SAVE the files in the C:\QHelpQ sub-DIR to a FLOPPY and then
  304. echo          DELETE the C:\QHelpQ files.
  305. echo.
  306. echo     OR   SAVE the files in the C:\QHelpQ\QHelpQ.OLD sub-DIR to a FLOPPY,
  307. echo          and then DELETE the files in  the C:\QHelpQ\QHelpQ.OLD sub-DIR.
  308. echo          It is NOT necessary to remove the C:\QHelpQ\QHelpQ.OLD sub-DIR.
  309. echo.
  310. echo               ┌──────────────────────────────────────────────────┐
  311. echo               │ If you do NOT want to SAVE your C:\QHelpQ files, │
  312. echo               │ PRESS any key to CONTINUE QHelpQ INSTALLATION... │
  313. echo               └──────────────────────────────────────────────────┘
  314. echo 
  315. pause > nul
  316. cls
  317. goto CopyYes
  318.  
  319. :DiskFull
  320. cls
  321. echo                                  QHSETUP.BAT
  322. echo.
  323. echo DISK FULL ERROR !
  324. echo ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀  There is probably NOT enough HARD DISK space to SAVE the
  325. echo                  existing C:\QHelpQ files to C:\QHelpQ\QHelpQ.OLD sub-DIR.
  326. echo.
  327. echo                  Suggest you       COPY   your existing C:\QHelpQ files
  328. echo                  to a FLOPPY. Then DELETE your existing C:\QHelpQ files
  329. echo                  and re-RUN this QhSetup utility.
  330. echo.
  331. echo                  RESTORING system to pre-INSTALLATION conditions.
  332. if exist C:\QHelpQ\QHelpQ.OLD\*.* del C:\QHelpQ\QHelpQ.OLD\*.* < yes > nul
  333. if %V2%==2                        RD  C:\QHelpQ\QHelpQ.OLD
  334.  
  335. :Abort1
  336. echo.
  337. echo                           ABORTING QHelpQ INSTALLATION
  338. echo.
  339. if exist C:\QHelpQ\*.* CD C:\QHelpQ
  340.  
  341. :preEND
  342. echo.
  343. if exist C:\yes del C:\yes
  344. SET V1=
  345. SET V2=
  346. SET V3=
  347. echo.
  348. echo            If the QHelpQ INSTALLATION was run from a FLOPPY DRIVE;
  349. echo                AFTER the floppy drive LIGHT has gone OUT, you
  350. echo                CAN remove the diskette from the floppy drive.
  351. echo 
  352. goto END
  353.  
  354. :END
  355.